# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
_libname=jdepend
pkgname=java-${_libname}
pkgver=2.9.1
pkgrel=3
pkgdesc="Java library for generating design quality metrics"
arch=('any')
url="http://clarkware.com/software/JDepend.html"
license=('BSD')
depends=('java-runtime-headless')
makedepends=('apache-ant')
checkdepends=('apache-ant')
source=(http://www.clarkware.com/software/${_libname}-${pkgver}.zip)
sha512sums=('8cd65cbbb70fb905020a791e02a091a5037c22fa2bd7fd64eeb4369d036eaa7b3540c80c2bc7d7a8793e8dbfa4a316f8598278c2e26858275eda2030f01bfdbc')

build() {
  cd "${srcdir}/${_libname}-${pkgver}"
  ant jar
}

check() {
  cd "${srcdir}/${_libname}-${pkgver}"
  ant test
}

package() {
  cd "${srcdir}/${_libname}-${pkgver}"
  install -Dm644 dist/${_libname}-${pkgver}.jar ${pkgdir}/usr/share/java/${_libname}-${pkgver}.jar
  ln -s ${_libname}-${pkgver}.jar ${pkgdir}/usr/share/java/${_libname}.jar
  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
